/*
 * Thread.h
 *
 *  Created on: 30/04/2011
 *      Author: dela
 */

#ifndef THREAD_H_
#define THREAD_H_

#include <pthread.h>
#include "Mutex.h"

class Thread {
private:
	pthread_t thread;
	static void *starter(void *data);
protected:
	virtual void run() = 0;
	bool working;
	Mutex workingMutex;
	Thread() : working(true) {};
public:
	void join();
	void start();
	bool isWorking();
	void setWorking(bool working);
};

#endif /* THREAD_H_ */
